from openpyxl import load_workbook

workbook = load_workbook(filename='py_text.xlsx')
'''
print(workbook.sheetnames)
sheet = workbook['Sheet1']
print(sheet.dimensions)
'''

'''
sheet = workbook.active
print(sheet.dimensions)
cell = sheet['A1']
print(cell.value)
print(cell.row, cell.column, cell.coordinate)

cell = sheet.cell(row=2, column=3)
print(cell.value, cell.coordinate)

cells = sheet['A1:A5']
print(cells)

cells = sheet['A']  # 第A列
print(cells)

cells = sheet[3]  # 第三行
print(cells)
'''

sheet = workbook.active

'''
for row in sheet.iter_rows(min_row=2, max_row=3, min_col=1, max_col=2):
    print(row)
    for cell in row:
        print(cell)
'''
for row in sheet.rows:
    print(row)
